// @ts-ignore
import NProgress from 'nprogress'

let loadingCount = 0

export function startLoading() {
  NProgress.start()
  loadingCount++
}

export function stopLoading() {
  loadingCount--
  if (loadingCount <= 0) NProgress.done()
}
